<html>
    <head>
        <title>batch-launcher 0.5.6 - Reference Documentation</title>
        <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" title="Style" charset="utf-8"/>
        <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8" />
    </head>
    <body class="body">
        <div id="header">
            <div class="images"><br/><br/>
                <a href="http://grails.org" target="_blank"><img alt="The Grails Framework" src="../img/grails.png" border="0"/></a>
                <span style="right:30px; top:20px; position:absolute;">
                    <a href="../index.html" target="_top">Frames</a> | <a href="index.html" target="_top">No Frames</a><br/><br/>
                    <a href="http://springsource.com" target="_blank"><img alt="SpringSource - A Division of VMware" src="../img/springsource-logo.png" border="0"/></a>
                </span>
            </div>
            <div class="message">batch-launcher</div>
            <h1>batch-launcher - Reference Documentation</h1>
            <p><strong>Authors:</strong> Daniel Henrique Alves Lima (text revised by Gislaine Fonseca Ribeiro and others)</p>
            <p><strong>Version:</strong> 0.5.6</p>
            <em></em>
        </div>

        <div id="toc">
            <h2>Table of Contents</h2>
            <div class="tocItem" style="margin-left:0px"><a href="#1. Introduction">1. Introduction</a></div><div class="tocItem" style="margin-left:10px"><a href="#1.1 Quick Start">1.1 Quick Start</a></div><div class="tocItem" style="margin-left:0px"><a href="#2. Miscellaneous">2. Miscellaneous</a></div><div class="tocItem" style="margin-left:10px"><a href="#2.1 Bootstrap Classes">2.1 Bootstrap Classes</a></div><div class="tocItem" style="margin-left:10px"><a href="#2.2 Participation in install-templates">2.2 Participation in install-templates</a></div><div class="tocItem" style="margin-left:10px"><a href="#2.3. Logging">2.3. Logging</a></div><div class="tocItem" style="margin-left:0px"><a href="#3. Version History">3. Version History</a></div>
        </div>
        <div id="content">
            <h1><a name="1. Introduction">1. Introduction</a></h1>This plugin enables the creation of Grails applications that will run without (outside of) a servlet/webapp container or a J(2)EE Application Server.
It allows:
<ul class="star">
<li>To start long running Grails (batch) processes;</li>
<li>To embed Grails in any regular Java application, container or server.</li>
</ul><p class="paragraph"/>The created application can use all non-servlet specific parts of a Grails application, like:
<ul class="star">
<li>GORM/Hibernate support;</li>
<li>Dependency Injection through Spring Framework;</li>
<li>Transactional service layer;</li>
<li>Grails Plugins (provided that the plugin does not depend of a servlet container or webapp environment to run - For example, quartz plugin).</li>
</ul><p class="paragraph"/><h2><a name="1.1 Quick Start">1.1 Quick Start</a></h2>Create your Grails application<p class="paragraph"/><div class="code"><pre>grails create&#45;app test&#45;batch&#45;prj
cd test&#45;batch&#45;prj</pre></div><p class="paragraph"/>Install the plugin<p class="paragraph"/><div class="code"><pre>grails install&#45;plugin batch&#45;launcher</pre></div><p class="paragraph"/>If you want, add "hello world" to your grails-app/conf/Main.groovy<p class="paragraph"/><div class="code"><pre>def run = &#123; context &#45;&#62;
     println <span class="java&#45;quote">"Hello world!"</span>
     println <span class="java&#45;quote">"App args are $&#123;context.args&#125;"</span> 
   &#125;</pre></div><p class="paragraph"/>Go ahead and run your application<p class="paragraph"/><div class="code"><pre>grails batch&#45;run&#45;app</pre></div><p class="paragraph"/>Prepare your application to deployment<p class="paragraph"/><div class="code"><pre>grails batch&#45;war</pre></div><p class="paragraph"/>Done!<h1><a name="2. Miscellaneous">2. Miscellaneous</a></h1>
<h2><a name="2.1 Bootstrap Classes">2.1 Bootstrap Classes</a></h2><a href="http://www.grails.org/Bootstrap%20Classes" target="blank">Grails Bootstrap Classes</a> are also supported by the plugin.<h2><a name="2.2 Participation in install-templates">2.2 Participation in install-templates</a></h2>The plugin will participate in <a href="http://grails.org/doc/latest/ref/Command%20Line/install-templates.html." target="blank">grails install-templates</a><p class="paragraph"/>A set of templates will be installed at src/templates/batch directory. Please, refer to <a href="../ref/Command Line/batch-war.html" class="Command Line">batch-war</a> to know how these templates will be handled.
<h2><a name="2.3. Logging">2.3. Logging</a></h2>You can enable bootstrap activity logging using the namespace 'org.grails.plugin.batch'.<p class="paragraph"/>For more information about Grails logging, please consult: <a href="http://grails.org/doc/latest/guide/3.%20Configuration.html#3.1.2%20Logging" target="blank">Grails Logging</a><p class="paragraph"/><blockquote class="warning">
Be aware that log4j is initialized after some other steps. If you want debug information from Bootstrap before log4j kick in, use <code>grails.plugins.batch.debugLauncher</code> system property.
</blockquote>
<h1><a name="3. Version History">3. Version History</a></h1><ul class="star">
<li>0.4.3</li>
<ul class="star">
<li>Required version of Grails was reduced from 1.3.3 to 1.2.5</li>
<li>Added 'batch-clean' command (BatchClean.groovy script)</li>
</ul>
<li>0.5.1</li>
<ul class="star">
<li>Initial support for scripting events</li>
</ul>
<li>0.5.3</li>
<ul class="star">
<li>BootStrap class usage replaced by Main class usage</li>
<li>Directory selection corrected for 'grails prod batch-run-app' and 'grails dev batch-war'</li>
<li>Modified launcher scripts (.sh and .bat)</li>
</ul>
<li>0.5.5</li>
<ul class="star">
<li>Main package renamed</li>
<li>Classes deprecated</li>
</ul>
<li>0.5.6</li>
<ul class="star">
<li>Packages renamed to meet the standard</li>
<li>Deprecated classes removed</li>
</ul></ul><p class="paragraph"/>
        </div>
        <div id="footer">
             
        </div>
    </body>
</html>
